{include file="public/cate" /}
<div class="layui-container">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            
            {if condition="isset($top)"}
            <div class="fly-panel">
                <div class="fly-panel-title fly-filter">
                    <a>置顶</a>
                    <a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>
                </div>
                <ul class="fly-list">
                    {volist name='top' id='ques'}
                    <li>
                        <a href="/u/168" class="fly-avatar">
                            <img src="__ROOT__/{$ques.face}" alt="贤心"></a>
                        <h2>
                            <a class="layui-badge">{$ques.cname}</a>
                            <a href="{:url('index/jie/index',['qid'=>$ques.qid])}">{$ques.title}</a></h2>
                        <div class="fly-list-info">
                            <a href="/u/168" link>
                                <cite>{$ques.username}</cite>
                                <i class="iconfont icon-renzheng" title="认证信息：layui 作者"></i>
                            </a>
                            <span>{:Ftime($ques.ctime)}</span>
                            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                <i class="iconfont icon-kiss"></i>{$ques.kiss}</span>
                            <span class="fly-list-nums">
                                <i class="iconfont icon-pinglun1" title="回答"></i>{$ques.reply_num}</span>
                        </div>
                        <div class="fly-list-badge"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            {/if}

            <div class="fly-panel" style="margin-bottom: 0;">
                <div class="fly-panel-title fly-filter">
                    <a class="{:input('status')=='0'||input('status')=='1'||input('is_jing')=='1'?'':'layui-this'}" href="{:url('index/index/index',['cid'=>input('cid')])}">综合</a>
                    <span class="fly-mid"></span>
                    <a class="{:input('status')=='0'?'layui-this':''}" href="{:url('index/index/index',['status'=>0,'cid'=>input('cid')])}">未结</a>
                    <span class="fly-mid"></span>
                    <a class="{:input('status')=='1'?'layui-this':''}" href="{:url('index/index/index',['status'=>1,'cid'=>input('cid')])}">已结</a>
                    <span class="fly-mid"></span>
                    <a class="{:input('is_jing')=='1'?'layui-this':''}" href="{:url('index/index/index',['is_jing'=>1,'cid'=>input('cid')])}">精华</a>
                </div>
                <ul class="fly-list">
                    {volist name='all' id='ques'}
                    <li>
                        <a href="/u/168" class="fly-avatar">
                            <img src="__ROOT__/{$ques.face}" alt="贤心"></a>
                        <h2>
                            <a class="layui-badge">{$ques.cname}</a>
                            <a href="{:url('index/jie/index',['qid'=>$ques.qid])}">{$ques.title}</a></h2>
                        <div class="fly-list-info">
                            <a href="/u/168" link>
                                <cite>{$ques.username}</cite>
                                <i class="iconfont icon-renzheng" title="认证信息：layui 作者"></i>
                            </a>
                            <span>{:Ftime($ques.ctime)}</span>
                            <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻">
                                <i class="iconfont icon-kiss"></i>{$ques.kiss}</span>
                            {if condition="$ques.status"}
                            <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
                            {/if}
                            <span class="fly-list-nums">
                                <i class="iconfont icon-pinglun1" title="回答"></i>{$ques.reply_num}</span>
                        </div>
                        <div class="fly-list-badge">
                            {if condition="$ques.is_jing"}
                            <span class="layui-badge layui-bg-red">精帖</span>
                            {/if}
                        </div>
                    </li>
                    {/volist}
                </ul>
                <style>
                    .laypage-main{
                        border: 0px solid #000;
                    }
                    .pagination{
                        padding:0px;
                        border: 0px solid #000;
                    }
                    .pagination li{
                        padding: 0px;
                        margin-right: 5px;
                        border: 1px solid #009E94;
                    }
                    .pagination li.active{
                        background: #009E94;
                        color: #fff;
                    }

                    .pagination li.disabled{
                        /*background: #ccc;*/
                        color: #ccc;
                    }
                    

                    .pagination li a,.pagination li span{
                        padding: 0 10px;
                        border: 0px solid #009E94;
                    }




                </style>
                <div style="text-align: center">
                    <div class="laypage-main">
                        {$all->render()}
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="fly-panel">
                <h3 class="fly-panel-title">温馨通道</h3>
                <div class="layui-row fly-panel-main" style="padding: 15px;">
                    <div class="layui-clear fly-list-quick">
                        <div class="layui-col-xs6">
                            <div>
                                <a href="https://fly.layui.com/extend" target="_blank">组件平台</a></div>
                        </div>
                        <div class="layui-col-xs6">
                            <div>
                                <a href="http://fly.layui.com/case/2018/" target="_blank">年度案例</a></div>
                        </div>
                        <div class="layui-col-xs6">
                            <div>
                                <a href="http://fly.layui.com/jie/4281/" target="_blank">Git 仓库</a></div>
                        </div>
                        <div class="layui-col-xs6">
                            <div>
                                <a href="http://fly.layui.com/jie/30227/" target="_blank">精贴集锦</a></div>
                        </div>
                        <div class="layui-col-xs6">
                            <div>
                                <a href="http://fly.layui.com/jie/13435/" target="_blank">关于飞吻</a></div>
                        </div>
                        <div class="layui-col-xs6">
                            <div>
                                <a href="http://www.layui.com/template/fly/" target="_blank">Fly 社区模板</a></div>
                        </div>
                        <a name="signin"></a>
                    </div>
                </div>
            </div>
            <div class="fly-panel fly-signin">
                <div class="fly-panel-title">签到
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinHelp">说明</a>
                    <i class="fly-mid"></i>
                    <a href="javascript:;" class="fly-link" id="LAY_signinTop">活跃榜
                        <span class="layui-badge-dot"></span>
                    </a>
                    {if condition="$signInfo.is_login"}
                    <span class="fly-signin-days">已连续签到<cite>{$signInfo.snum}</cite>天</span>
                    {/if}

                </div>
                <div class="fly-panel-main fly-signin-main">
                    {if condition="$signInfo.is_sign"}
                        <button class="layui-btn layui-btn-disabled">今日已签到</button>
                    {else/}
                        <button class="layui-btn layui-btn-danger" id="signin">今日签到</button>
                    {/if}

                    {if condition="$signInfo.is_login"}
                    <span>可获得<cite>{$signInfo.kiss}</cite>飞吻</span>
                    {/if}

                </div>
            </div>
            <div class="fly-panel">
                <div class="fly-panel-title">钻级赞助商
                    <span class="fly-mid"></span>
                    <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a></div>
                <div class="fly-panel-main" style="padding: 13px 15px;">
                    <a href="http://os.opensns.cn/product/index/download?fly" target="_blank" rel="nofollow" class="fly-zanzhu fly-zanzhu-img" time-limit="2018-10-05 0:0:0">
                        <img src="//cdn.layui.com/upload/2018_8/168_1535714227780_79253.png" alt="opensns"></a>
                    <a href="http://www.larryms.com/cates/5.html" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #64BF98;" time-limit="2018-10-05 0:0:0">60秒极速上手，layui案例排名NO1后台框架</a></div>
            </div>
            <div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
                <h3 class="fly-panel-title">回贴周榜</h3>
                <dl>
                    {volist name="weekHot" id="row"}
                    <dd>
                        <a href="{:url('index/user/center',['uid'=>$row.uid])}">
                            <img src="__ROOT__/{$row.face}">
                            <cite>{$row.username}</cite>
                            <i>{$row.cn}次回答</i>
                        </a>
                    </dd>
                    {/volist}
                </dl>
            </div>
            {include file="public/weekhot" /}
            <div class="fly-panel">
                <div class="fly-panel-title">官方产品</div>
                <div class="fly-panel-main">
                    <a href="http://www.layui.com/admin/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #20222A; background-image: linear-gradient(to right,#20222A,#3E4251);">layuiAdmin - layui 官方后台管理模板</a>
                    <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #009688; background-image: linear-gradient(to right,#009688,#5FB878);">LayIM - layui 即时通讯旗舰之作</a></div>
            </div>
            <div class="fly-panel" style="padding: 20px 0; text-align: center;">
                <img src="//cdn.layui.com/upload/2017_8/168_1501894831075_19619.jpg" style="max-width: 100%;" alt="layui">
                <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p></div>
            <div class="fly-panel fly-link">
                <h3 class="fly-panel-title">友情链接</h3>
            </div>
        </div>
    </div>
</div>
    <script>
  //Demo
  layui.use(['form','jquery'], function(){
    var form = layui.form;
    var $ = layui.jquery;


    $('#signin').click(function(event) {

        $.get('{:url('index/user/sign')}', function(res) {

            if(res.code==0){
              layer.msg(res.msg, function(){});
            }else{
              layer.alert(res.msg, {icon: 6},function(){
                  location.reload();
              });
            }
            
        });
        
    });
    
    //监听提交
    form.on('submit(xbs)', function(data){
      $.ajax({
        url: '{:url('index/reg/adduser')}',
        type: 'POST',
        dataType: 'json',
        data: data.field,
      })
      .done(function(res) {
        if(res.code==0){
          layer.msg(res.msg, function(){
          //关闭后的操作
          });
          $('#code').click();
        }else{
          layer.alert('恭喜你，注册成功！', {icon: 6},function(){
              location.href = "{:url('index/login/index')}";
          });
        }
      })
      .fail(function() {
        console.log("error");
      })
      .always(function() {
        console.log("complete");
      });
      
      return false;
    });
  });
    </script>